package lookandfeel;

import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.JButton;

public class customButton extends JButton {

	private static final long serialVersionUID = 1L;

	public customButton(String text){
		//set text
		this.setText(text);
		//remove text border
		this.setFocusPainted(false);
		//add hover effect
		this.addMouseListener(new mouseActions());	
	}
	//button hover effects
	class mouseActions extends MouseAdapter{
		//new colorscheme instance
		colorScheme lookAndFeel = colorScheme.getColorScheme();
		public void mouseEntered(MouseEvent e){
			setBackground(lookAndFeel.getBtnHover());
		}
		public void mouseExited(MouseEvent e){
			setBackground(lookAndFeel.getBtnBackground());
		}
	}
}
